= form_for @product, html: { class: 'ui form', id: 'product-new', enctype: 'multipart/form-data' } do |f|
  - @product.errors.any?
    - @product.errors.full_messages.each do |error|
      .error-form = error
  .form-title
    | 产品信息
    .form-des 提交产品必须是2017年内上线、或有重大更新、或有瞩目成长、或有杰出成就的产品和公司。
  .row
    .col-md-6
      .form-group
        = f.label :name, '产品名称'
        = f.text_field :name, class: 'form-control', placeholder: 'XX产品／XX产品2.0'
    .col-md-6
      .form-group.publish-date
        = f.label :published_at, '上线或版本更新'
        #publish-date
          input.hide name="#{f.object_name}[published_at]" type="date" v-model="date"
          select.form-control.year v-model="year" v-on="change: update"
            - 16.times do |index|
              option value="#{Time.new.year.to_i - index}" = Time.new.year.to_i - index
          | 年
          select.form-control.month v-model="month" v-on="change: update"
            - 12.times do |index|
              option value="#{index + 1}" = index + 1
          | 月
  .row
    .col-xs-12
      .form-group
        = f.label :category, '产品类别', class: 'block'
        - Product.category.values.each do |item|
          label.checkbox-inline
            = f.radio_button :category, item
            = t "activerecord.attributes.product.category.#{item}"
  .row
    .col-xs-12.form-group.recommended-group
      = f.label :recommended_platform, '推荐机构'
      span.warning
        | (选填，请填写推荐机构名称，点击「添加」按钮)
      #recommended-platform.recommended-platform
        input.hide.validator-not-require name="#{f.object_name}[recommended_platform]" type="text" v-model="platformList"
        .platform-list
          .item v-repeat="platform in platformList"
            | {{ platform }}
            a.remove href="javascript:;" v-on="click: removePlatform($index)"
              i.iconfont.icon-close

        input.form-control.platform-form-control{
          v-model="newPlatform"
          v-on="keyup:addPlatform | key 'enter'"
        }
        button type="button" v-on="click:addPlatform"
          | 添加
  .row
    .col-xs-12.form-group
      = f.label :summary, '产品描述'
      = f.text_field :summary, class: 'form-control validator-max-length', placeholder: '为您的产品添加一句40字以内的描述，彰显产品的亮点', data: {length: 80}
    .col-xs-12.form-group
      = f.label :description, '详细描述'
      = f.text_area :description, class: 'form-control mh100 validator-max-length', placeholder: '请为您的产品添加详细精彩的描述，包括但不限于功能、服务、突出的用户体验及年内重要更新等...300字以内', data: {length: 600}
    .col-xs-12.form-group
      = f.label :note, '备注（选填）'
      = f.text_field :note, class: 'form-control validator-max-length validator-not-require', placeholder: '如有其他备注信息请在这里添加', data: {length: 80}
  .row
    .col-md-6.form-group
      = f.label :url, '产品网址'
      = f.text_field :url, class: 'form-control', placeholder: 'http://example.com', data: {rule: ['url']}
    .col-md-6.form-group
      = f.label :weibo, '微博地址（选填）'
      = f.text_field :weibo, class: 'form-control validator-not-require', placeholder: 'http://weibo.com/example', data: {rule: ['weibo']}
  .row
    .col-md-6.form-group#logo-upload
      = f.label :logo, '产品 LOGO'
      .block
        .template.hide
          span.image-upload-icon.oval-button
            input data-name="#{f.object_name}[logo]" type="file"
        #preview
      .upload-desc 请上传1张产品 Logo 或主形象照片，尺寸大于256 x 256px
    .col-md-6.form-group#product-upload
      = f.label :screenshots, '产品图片'
      .block
        .template.hide
          span.image-upload-icon.oval-button
            input data-name="#{f.object_name}[screenshots][]" type="file"
        #preview
      .upload-desc 请上传1至6张产品图片，包括宣传图、产品图等，高度大于400px
  .clearfix
  h2.form-title.contact-title 联系人信息
  .row
    .col-md-4.form-group
      = f.label :c_name, '联系人姓名'
      = f.text_field :c_name, class: 'form-control', placeholder: '请填写您的真实姓名'
    .col-md-4.form-group
      = f.label :c_email, '邮箱'
      = f.text_field :c_email, class: 'form-control', placeholder: '请填写您的工作邮箱', data: {rule: ['email']}
    .col-md-4.form-group
      = f.label :c_mobile, '电话'
      = f.text_field :c_mobile, class: 'form-control', placeholder: '请填写用于联系您的手机号码'
  .row
    .col-md-4.form-group
      = f.label :c_corp, '公司'
      = f.text_field :c_corp, class: 'form-control', placeholder: '请填写您的公司全称'
    .col-md-4.form-group
      = f.label :c_position, '职位'
      = f.text_field :c_position, class: 'form-control', placeholder: '请填写您在公司的职位'
    .col-md-4.form-group
      = f.label :c_corp_addr, '公司地址'
      = f.text_field :c_corp_addr, class: 'form-control', placeholder: '请填写您的公司地址'
  .row.tac
    a.btn.theme-btn.hover-border.submit.loading#submit href="javascript:;"
      span.unload-text 提交信息
